<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function myFoo(){
        var i = 0;
        function foo(){

            i = i + 1;
            console.log(i);
        }
        return foo;
    }
    var f = myFoo();
    var f2 = myFoo();
    //第一个按钮点击的事件
    f();
    f();
    f();
    f();
    f();
    f();


    //foo();
    f2();
    f2();
    f2();
    f2();

</script>
</body>
</html>